package backed.repository;

import backed.entity.EcoQARecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface AiRepository extends JpaRepository<EcoQARecord, Long> {
    /**
     * 根据用户ID查找问答记录
     */
    Optional<EcoQARecord> findByUserId(Long userId);
    
    /**
     * 根据问题内容模糊查询相关记录
     */
    List<EcoQARecord> findByQuestionContaining(String keyword);
}
